<?php

require_once dirname(__FILE__).'/../lib/productoGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/productoGeneratorHelper.class.php';

/**
 * producto actions.
 *
 * @package    administracion-ventas
 * @subpackage producto
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $
 */
class productoActions extends autoProductoActions
{
    public function executeReponerStock(sfWebRequest $request)
    {
        $this->form = new StockForm();

        $this->prod = ProductoPeer::retrieveByPK($request->getParameter('id'));
    }


    public function executeReponer(sfWebRequest $request)
    {
        $this->forward404Unless($request->isMethod('post'));

        $this->form = new StockForm();

        $this->processForm($request, $this->form);
    }

    public function processForm(sfWebRequest $request, sfForm $form)
    {
        $form->bind($request->getParameter($form->getName()), $taintedFiles = null);

        if ($form->isValid())
        {
            $stock = $form->save();

            $this->redirect('producto/index');
        }
        
    }
}
